<%-- begin document --%>
<?xml version = "1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<%@
    page language = "java" 
    import = "vinnichenko.lab3.*, java.util.*" 
    session = "true"
%>
<%@ taglib uri = "WEB-INF/taglib.tld" prefix = "vinnichenko" %>
<!-- begin document -->
<html xmlns = "http://www.w3.org/1999/xhtml">

<head>
   <title>Hierarchy of the company</title>

   <link rel = "stylesheet" href = "styles.css" 
      type = "text/css" />
</head>

<body>
   <p class = "bigFont">Employees</p>

   <p class = "bold">Click a link to view person information</p>

    <%Integer maxLevel = 0;%>
    <vinnichenko:emplist>
        <%if(level > maxLevel)maxLevel = level; %>
    </vinnichenko:emplist>

      <table>
         <vinnichenko:emplist>
            <tr>
            <% for(int i = 1; i <= maxLevel; i++) {
                if( level == i) {%>
                    <td>
                        <a href = "displayPersonInfo?empno=<%= empno %>"><%= ename %></a>, 
                        (<%= job %>)
                    </td>
                <%}else {%>
                    <td></td>
                <%}%>
            <%}%>
            </tr>
         </vinnichenko:emplist>
      </table>
    <form method = "get">
    <p>
        <a href = "addNewPersonServlet">Add new person to company</a>
    </p>
    </form>
    <p>
        <a href = "index.html">Go to main page</a>
        <!--&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-->
        <a href = "SimpleTable.jsp">View as simple table</a>
    </p>

</body> 

</html>